﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_DMHangMucBaoCaoThue : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CboPhatSinh")]
        private ComboBox _CboPhatSinh;
        [AccessedThroughProperty("CmdAddRow")]
        private Button _CmdAddRow;
        [AccessedThroughProperty("CmdDelRow")]
        private Button _CmdDelRow;
        [AccessedThroughProperty("CmdExit")]
        private Button _CmdExit;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel2")]
        private Panel _Panel2;
        [AccessedThroughProperty("VSList")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSList;
        private IContainer components;
        private clsDMLoaiHoaDon objLHD;

        public Frm_DMHangMucBaoCaoThue()
        {
            base.Load += new EventHandler(this.Frm_DMHangMucBaoCaoThue_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.objLHD = new clsDMLoaiHoaDon();
            this.InitializeComponent();
        }

        private void CmdAddRow_Click(object sender, EventArgs e)
        {
            if (this.VSList.Rows.Count == 1)
            {
                this.VSList.AddItem("");
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[this.VSList.Rows.Count - 1, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.VSList.AddItem("");
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_DMHangMucBaoCaoThue_Load(object sender, EventArgs e)
        {
            this.CboPhatSinh.Items.Clear();
            this.CboPhatSinh.Items.Add("");
            this.CboPhatSinh.Items.Add(modGeneral.Tranlated("Mua v\x00e0o", ""));
            this.CboPhatSinh.Items.Add(modGeneral.Tranlated("B\x00e1n ra", ""));
            this.CboPhatSinh.SelectedIndex = 0;
            Hashtable hashtable = new Hashtable();
            hashtable.Add("MV", modGeneral.Tranlated("Mua v\x00e0o", ""));
            hashtable.Add("BR", modGeneral.Tranlated("B\x00e1n ra", ""));
            this.VSList.Cols[2].DataMap = hashtable;
            this.LoadData();
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_DMHangMucBaoCaoThue));
            this.Panel1 = new Panel();
            this.CmdExit = new Button();
            this.Label5 = new Label();
            this.CboPhatSinh = new ComboBox();
            this.Panel2 = new Panel();
            this.CmdDelRow = new Button();
            this.CmdAddRow = new Button();
            this.VSList = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel1.SuspendLayout();
            this.Panel2.SuspendLayout();
            this.VSList.BeginInit();
            this.SuspendLayout();
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel1.Controls.Add(this.CmdExit);
            this.Panel1.Controls.Add(this.Label5);
            this.Panel1.Controls.Add(this.CboPhatSinh);
            this.Panel1.Dock = DockStyle.Top;
            Point point = new Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            Size size = new Size(0x2eb, 0x23);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0;
            this.CmdExit.Image = ACCOUNTING.My.Resources.Resources.Closed;
            this.CmdExit.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x288, 4);
            this.CmdExit.Location = point;
            this.CmdExit.Name = "CmdExit";
            size = new Size(90, 0x19);
            this.CmdExit.Size = size;
            this.CmdExit.TabIndex = 0x93;
            this.CmdExit.Text = "&Tho\x00e1t";
            this.CmdExit.UseVisualStyleBackColor = true;
            this.Label5.AutoSize = true;
            this.Label5.BackColor = Color.Transparent;
            point = new Point(11, 9);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            size = new Size(0x49, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x92;
            this.Label5.Text = "Loại ph\x00e1t sinh";
            this.CboPhatSinh.FormattingEnabled = true;
            this.CboPhatSinh.Items.AddRange(new object[] { "Mua V\x00e0o", "B\x00e1n ra" });
            point = new Point(90, 6);
            this.CboPhatSinh.Location = point;
            this.CboPhatSinh.Name = "CboPhatSinh";
            size = new Size(0xcc, 0x15);
            this.CboPhatSinh.Size = size;
            this.CboPhatSinh.TabIndex = 0x91;
            this.Panel2.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel2.Controls.Add(this.CmdDelRow);
            this.Panel2.Controls.Add(this.CmdAddRow);
            this.Panel2.Dock = DockStyle.Bottom;
            point = new Point(0, 0x1d4);
            this.Panel2.Location = point;
            this.Panel2.Name = "Panel2";
            size = new Size(0x2eb, 0x22);
            this.Panel2.Size = size;
            this.Panel2.TabIndex = 1;
            this.CmdDelRow.Image = (Image) manager.GetObject("CmdDelRow.Image");
            this.CmdDelRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(100, 6);
            this.CmdDelRow.Location = point;
            this.CmdDelRow.Name = "CmdDelRow";
            size = new Size(0x59, 0x18);
            this.CmdDelRow.Size = size;
            this.CmdDelRow.TabIndex = 13;
            this.CmdDelRow.Text = "&2.X\x00f3a d\x00f2ng";
            this.CmdDelRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdDelRow.UseVisualStyleBackColor = true;
            this.CmdAddRow.Image = (Image) manager.GetObject("CmdAddRow.Image");
            this.CmdAddRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(3, 6);
            this.CmdAddRow.Location = point;
            this.CmdAddRow.Name = "CmdAddRow";
            size = new Size(0x5c, 0x18);
            this.CmdAddRow.Size = size;
            this.CmdAddRow.TabIndex = 12;
            this.CmdAddRow.Text = "&1.Th\x00eam d\x00f2ng";
            this.CmdAddRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdAddRow.UseVisualStyleBackColor = true;
            this.VSList.AutoResize = false;
            this.VSList.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
            this.VSList.ColumnInfo = "3,0,0,0,0,85,Columns:0{Caption:\"Kh\x00f3a\";Visible:False;}\t1{Width:622;Caption:\"Nội dung\";}\t2{Width:96;Caption:\"Loại ph\x00e1t sinh\";}\t";
            this.VSList.Dock = DockStyle.Fill;
            this.VSList.ExtendLastCol = true;
            point = new Point(0, 0x23);
            this.VSList.Location = point;
            this.VSList.Name = "VSList";
            this.VSList.Rows.Count = 1;
            this.VSList.Rows.DefaultSize = 0x11;
            size = new Size(0x2eb, 0x1b1);
            this.VSList.Size = size;
            this.VSList.StyleInfo = manager.GetString("VSList.StyleInfo");
            this.VSList.TabIndex = 2;
            this.VSList.VisualStyle = VisualStyle.Office2007Blue;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x2eb, 0x1f6);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.VSList);
            this.Controls.Add(this.Panel2);
            this.Controls.Add(this.Panel1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Frm_DMHangMucBaoCaoThue";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "HANG MUC BAO CAO THUE";
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.Panel2.ResumeLayout(false);
            this.VSList.EndInit();
            this.ResumeLayout(false);
        }

        public void LoadData()
        {
            if (this.CboPhatSinh.SelectedIndex == 1)
            {
            }
            if (this.CboPhatSinh.SelectedIndex == 1)
            {
            }
            DataTable listKhoanMuc = this.objLHD.GetListKhoanMuc("");
            int num2 = listKhoanMuc.Rows.Count - 1;
            for (int i = 0; i <= num2; i++)
            {
                C1.Win.C1FlexGrid.C1FlexGrid vSList = this.VSList;
                vSList.AddItem("");
                vSList[vSList.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(listKhoanMuc.Rows[i]["Khoa"]);
                vSList[vSList.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(listKhoanMuc.Rows[i]["NoiDung"]);
                vSList[vSList.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(listKhoanMuc.Rows[i]["LoaiPhatSinh"]);
                vSList = null;
            }
        }

        public void UpdateData(int nRow)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[nRow, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                this.VSList[nRow, 0] = modGeneral.CreatKey("DM_HangMucBaoCaoThue", 15, "");
            }
            this.objLHD.SaveHangMuc(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[nRow, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[nRow, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[nRow, 2]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
        }

        private void VSList_AfterEdit(object sender, RowColEventArgs e)
        {
            if ((LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[e.Row, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "") & (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[e.Row, 2]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != ""))
            {
                this.UpdateData(e.Row);
            }
        }

        internal virtual ComboBox CboPhatSinh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboPhatSinh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboPhatSinh = value;
            }
        }

        internal virtual Button CmdAddRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAddRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAddRow_Click);
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click -= handler;
                }
                this._CmdAddRow = value;
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click += handler;
                }
            }
        }

        internal virtual Button CmdDelRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDelRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdDelRow = value;
            }
        }

        internal virtual Button CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel2 = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSList
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSList;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSList_AfterEdit);
                if (this._VSList != null)
                {
                    this._VSList.AfterEdit -= handler;
                }
                this._VSList = value;
                if (this._VSList != null)
                {
                    this._VSList.AfterEdit += handler;
                }
            }
        }
    }
}

